pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let numbers = num_str
        .split_terminator(&['(', ')'][..])
        .collect::<Vec<&str>>()
        .iter()
        .map(|s| s.parse::<u32>().unwrap())
        .collect::<Vec<u32>>();
    let (num, base) = (numbers[0], numbers[1]);
    println!("num: {}, base: {}, to_base: {}", num, base, to_base);

    let mut times = 0;
    let act_num = num
        .to_string()
        .split("")
        .map(|s| s.to_string())
        .filter(|s| !s.is_empty())
        .collect::<Vec<String>>()
        .iter()
        .rev()
        .fold(0, |acc, x| {
            let n = x.parse::<u32>().unwrap();
            let result = acc + base.pow(times) * n;
            times += 1;
            result
        });

    let mut result = String::new();
    let mut reminder = act_num;

    while reminder > 0 {
        let i = reminder % to_base;
        if to_base != 16 {
            result.push_str(&i.to_string());
        } else {
            let c = char::from_digit(i, 16).unwrap();
            result.push(c);
        }
        reminder /= to_base;
    }
    println!("{}", result.chars().rev().collect::<String>());

    result.chars().rev().collect()
}
